{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 各主流摄像头的rtsp地址格式\n",
    "\n",
    "\n",
    "## 海康威视\n",
    "\n",
    "### IPC 摄像头\n",
    "\n",
    ">rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/av_stream\n",
    "\n",
    "说明：\n",
    "- username: 用户名。例如admin。\n",
    "- password: 密码。例如12345。\n",
    "- ip: 为设备IP。例如 192.0.0.64。\n",
    "- port: 端口号默认为554，若为默认可不填写。\n",
    "- codec：有h264、MPEG-4、mpeg4这几种。\n",
    "- channel: 通道号，起始为1。例如通道1，则为ch1。\n",
    "- subtype: 码流类型，主码流为main，辅码流为sub。\n",
    "\n",
    "**例如**，请求海康摄像机通道1的主码流，Url如下\n",
    "主码流：\n",
    "- rtsp://admin:12345@192.0.0.64:554/h264/ch1/main/av_stream\n",
    "- rtsp://admin:12345@192.0.0.64:554/MPEG-4/ch1/main/av_stream\n",
    "\n",
    "子码流：\n",
    "- rtsp://admin:12345@192.0.0.64/mpeg4/ch1/sub/av_stream\n",
    "- rtsp://admin:12345@192.0.0.64/h264/ch1/sub/av_stream\n",
    "\n",
    "### NVR\n",
    "\n",
    "海康新版本，DS系列\n",
    "\n",
    "> rtsp://username:password@<address>:<port>/Streaming/Channels/<id>(?parm1=value1&parm2-=value2…)\n",
    "\n",
    "    举例说明：\n",
    "\n",
    "DS-9632N-ST的IP通道01主码流：\n",
    "\n",
    "rtsp://admin:12345@172.6.22.234:554/Streaming/Channels/101?transportmode=unicast\n",
    "\n",
    "DS-9016HF-ST的IP通道01主码流：\n",
    "\n",
    "rtsp://admin:12345@172.6.22.106:554/Streaming/Channels/1701?transportmode=unicast\n",
    "\n",
    "DS-9016HF-ST的模拟通道01子码流：\n",
    "\n",
    "rtsp://admin:12345@172.6.22.106:554/Streaming/Channels/102?transportmode=unicast  (单播)\n",
    "\n",
    "rtsp://admin:12345@172.6.22.106:554/Streaming/Channels/102?transportmode=multicast (多播)\n",
    "\n",
    "rtsp://admin:12345@172.6.22.106:554/Streaming/Channels/102 (?后面可省略，默认单播)\n",
    "\n",
    "DS-9016HF-ST的零通道主码流（零通道无子码流）：\n",
    "\n",
    "rtsp://admin:12345@172.6.22.106:554/Streaming/Channels/001\n",
    "\n",
    "DS-2DF7274-A的第三码流：\n",
    "\n",
    "rtsp://admin:12345@172.6.10.11:554/Streaming/Channels/103\n",
    "\n",
    "更多信息：https://blog.csdn.net/xiejiashu/article/details/71786187\n",
    "    \n",
    "## 大华\n",
    "\n",
    ">rtsp://[username]:[password]@[ip]:[port]/cam/realmonitor?[channel]&[subtype]\n",
    "\n",
    "说明:\n",
    "- username: 用户名。例如admin。\n",
    "- password: 密码。例如admin。\n",
    "- ip: 为设备IP。例如 10.7.8.122。\n",
    "- port: 端口号默认为554，若为默认可不填写。\n",
    "- channel: 通道号，起始为1。例如通道2，则为channel=2。\n",
    "- subtype: 码流类型，主码流为0（即subtype=0），辅码流为1（即subtype=1）。\n",
    "\n",
    "**例如**，请求某设备的通道2的辅码流，Url如下\n",
    "\n",
    "rtsp://admin:admin@10.12.4.84:554/cam/realmonitor?channel=2&subtype=1\n",
    "\n",
    "## D-Link\n",
    ">rtsp://[username]:[password]@[ip]:[port]/[channel].sdp\n",
    "\n",
    "说明：\n",
    "- username：用户名。例如admin\n",
    "- password：密码。例如12345，如果没有网络验证可直接写成rtsp:// [ip]:[port]/[channel].sdp\n",
    "- ip：为设备IP。例如192.168.0.108。\n",
    "- port：端口号默认为554，若为默认可不填写。\n",
    "- channel：通道号，起始为1。例如通道2，则为live2。\n",
    "\n",
    "**例如**，请求某设备的通道2的码流，URL如下\n",
    "\n",
    "rtsp://admin:12345@192.168.200.201:554/live2.sdp\n",
    "\n",
    "## Axis（安讯士）\n",
    "\n",
    ">rtsp://[username]:[password]@[ip]/axis-media/media.amp?[videocodec]&[resolution]\n",
    "\n",
    "说明：\n",
    "- username：用户名。例如admin\n",
    "- password：密码。例如12345，如果没有网络验证可省略用户名密码部分以及@字符。\n",
    "- ip：为设备IP。例如192.168.0.108。\n",
    "- videocodec：支持MPEG、h.264等，可缺省。\n",
    "- resolution：分辨率，如resolution=1920x1080，若采用默认分辨率，可缺省此参数。\n",
    "\n",
    "**例如**，请求某设备h264编码的1280x720的码流，URL如下：\n",
    "\n",
    "rtsp:// 192.168.200.202/axis-media/media.amp?videocodec=h264&resolution=1280x720\n",
    "\n",
    "---\n",
    "\n",
    "内容来源:\n",
    "- https://blog.csdn.net/viola_lulu/article/details/53330727\n",
    "- https://blog.csdn.net/xiejiashu/article/details/71786187"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
